import request from '@/utils/request'

// 查询商品三级分类列表
export function listCategory(query) {
  return request({
    url: '/product/pmsCategory/list/tree',
    method: 'get',
    params: query
  })
}

// 查询商品三级分类详细
export function getCategory(catId) {
  return request({
    url: '/product/pmsCategory/' + catId,
    method: 'get'
  })
}

// 新增商品三级分类
export function addCategory(data) {
  return request({
    url: '/product/pmsCategory/add',
    method: 'post',
    data: data
  })
}

// 修改商品三级分类
export function updateCategory(data) {
  return request({
    url: '/product/pmsCategory/update',
    method: 'put',
    data: data
  })
}

// 删除商品三级分类
export function delCategory(catId) {
  return request({
    url: '/product/pmsCategory/' + catId,
    method: 'delete'
  })
}

//逻辑删除商品分类
export function logicDelCategory(catIds) {
  return request({
    url: '/product/pmsCategory/delete',
    method: 'put',
    data: catIds
  })
}

//批量更新商品分类
export function updateCategoryBatch(data) {
  return request({
    url: '/product/pmsCategory/batchUpdate',
    method: 'put',
    data: data
  })
}
